<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>员工信息</title>
</head>
<style type="text/css">
    table {border-collapse: collapse; font-size: 14px; width: 80%; margin: auto}
    table, th, td {border: 1px solid darkslategray;padding: 10px}
</style>
<body>

<div style="text-align: center">
    <span style="color: darkslategray; font-size: 30px">欢迎光临！</span>
    <button th:if="${userAndRole.rid}==1"><a th:href="@{/employee/toadd}">添加</a> </button>
    <hr/>
    <table class="list">
        <tr>
            <th>sid</th>
            <th>商品名</th>
            <th>价格</th>
            <th>库存</th>
            <th>失败原因</th>
            <th>状态</th>
            <th>操作</th>
        </tr>
        <tr th:each="user : ${shop}">
            <td th:text="${user.sid}"></td>
            <td th:text="${user.sname}"></td>
            <td th:text="${user.price}"></td>
            <td th:text="${user.num}"></td>
            <td><input th:text="${user.because}" th:if="${user.because}!=null"></td>
            <td th:text="未审核" th:if="${user.status}=='0'"></td>
            <td th:text="提交待审核" th:if="${user.status}=='1'"></td>
            <td th:text="审核通过" th:if="${user.status}=='2'"></td>
            <td th:text="审核失败" th:if="${user.status}=='3'"></td>
            <td th:text="上架" th:if="${user.status}=='4'"></td>
            <td th:text="下架" th:if="${user.status}=='5'"></td>
            <td><a th:href="@{/shop/findById(id=${user.sid})}" th:if="${userAndRole.rid}==1">修改</a>
                <a th:href="@{/shop/delById(id=${user.sid})}" th:if="${userAndRole.rid}==1">删除</a>
                <a th:href="@{/shop/getOn(id=${user.sid})}" th:if="${userAndRole.rid}==1">启用</a>
                <a th:href="@{/shop/pass(id=${user.sid})}" th:if="${userAndRole.rid}==2">审核通过</a>
                <a th:href="@{/shop/wrong(id=${user.sid})}" th:if="${userAndRole.rid}==2">审核失败</a>
                <a th:href="@{/shop/up(id=${user.sid})}" th:if="${userAndRole.rid}==2">上架</a>
                <a th:href="@{/shop/down(id=${user.sid})}" th:if="${userAndRole.rid}==2">下架</a>
            </td>
        </tr>
    </table>
</div>
</body>
</html>